<template>
	<view class="p20">
		<view class="fs30 tit-ac mb12 relative ml20">
			<text>资格证书</text>
		</view>
		<!-- <view class="flex row-between">
			<image :src="item" v-for="(item,index) in $user.certificate_img" :key="index"
				@click="$tool.lookImg($user.certificate_img,index)" class="w320 h348" mode="widthFix"></image>
		</view> -->
		<imgList max="9" size="226" @success="ids=>form.certificate=ids" :ids="form.certificate"
			:paths="$user.certificate_img"></imgList>
		<view class="h120"></view>
		<view class="pf bottom0 left0  w-max" v-if="form.certificate!=$user.certificate">
			<view class="p20">
				<u-button type="warning" ripple @click="submit">保存</u-button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				form: {
					certificate: ''
				}
			};
		},
		onLoad() {
			this.form.certificate = this.$user.certificate
		},
		methods: {
			submit(e) {
				let params = {
					certificate: e.id
				}
				this.$request('/master/my/editInfo', params).then(res => {
					this.$msg(res.msg)
					this.$getUser()
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #F8F8F8;
	}
</style>
